<template>
  <div class="container">
    <el-dialog
      title="已加工详情"
      :visible.sync="dialog.centerDialogVisible"
      @open="getData"
      @close="confirm"
      center
    >
        <div class="title">加工出库</div>
      <el-table :data="tableData" border style="width: 100%" empty-text="暂无数据">
        <el-table-column prop="out.serial_code" label="加工出库编号" align="center"></el-table-column>
        <el-table-column prop="out.source_goods_inp.code" label="批次号" align="center"></el-table-column>
        <el-table-column prop="sort_info.goods_name" label="商品名称" align="center"></el-table-column>
        <el-table-column prop="sort_info.out_num" label="商品数量" align="center"></el-table-column>
        <el-table-column prop="sort_info.qty_num" label="商品箱数" align="center"></el-table-column>
        <el-table-column prop="out.source_goods_inp.unit" label="单位" align="center"></el-table-column>
        <el-table-column prop="out.source_goods_inp.spec" label="规格" align="center"></el-table-column>
        <el-table-column prop="sort_info.bad_num" label="烂果数量" align="center"></el-table-column>
        <el-table-column prop="sort_info.can_sale_bad_num" label="可卖烂果数量" align="center"></el-table-column>
        <el-table-column prop="sort_info.can_sale_bad_price" label="可卖烂果数量价格" align="center"></el-table-column>
      </el-table>
        <div class="title">加工入库</div>
        
     <el-table :data="tableData1" border style="width: 100%" empty-text="暂无数据">
       <el-table-column prop="serial_code" label="加工出库编号" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.code" label="批次号" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.goods_name" label="商品名称" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.inp_num" label="商品数量" align="center"></el-table-column>
        <el-table-column prop="price" label="入库价格" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.qty" label="商品箱数" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.unit" label="单位" align="center"></el-table-column>
        <el-table-column prop="to_goods_inp.spec" label="规格" align="center"></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { particulars } from "@/api/sorting/sortingList";
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: [],
      tableData1: [],

    };
  },
  created(){
  },
  methods: {
    //关闭
    confirm() {
      this.dialog.centerDialogVisible = false;
    },
    // 获取数据
    getData() {
        this.tableData = [];
      this.center = [];
      let data = {
        id: this.dialog.id
      };
      particulars(data).then(res => {
        if (res.code == 0) {
          this.tableData.push(res.data);
          this.tableData1 = res.data.in
        }
      });
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
  background-size: cover;
}
.title{
    text-align: center;
    line-height: 40px;
    font-size: 16px;
    font-weight: bold;
}
</style>